package com.note.service;

import com.note.mapper.AdminsMapper;
import com.note.mapper.UserMapper;
import com.note.pojo.Admins;
import com.note.pojo.Comm;
import com.note.pojo.Note;
import com.note.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminsMapper adminsMapper;
    @Autowired
    private UserMapper userMapper;

    @Override
    public Admins getAdminByName(String name) {
        return adminsMapper.getAdminByName(name);
    }

    @Override
    public List<User> getUsers() {
        return adminsMapper.getUsers();
    }

    @Override
    public void delUser(Integer id) {
        adminsMapper.delUser(id);
    }

    @Override
    public List<Note> getNotes() {
        return adminsMapper.getNotes();
    }

    @Override
    public List<Comm> getComs() {
        return adminsMapper.getComs();
    }

    @Override
    public void addAdmin(Admins admins) {
        adminsMapper.inserAdmin(admins);
    }

    @Override
    public List<Admins> getAdms() {
        return adminsMapper.getAdms();
    }

    @Override
    public void delAdm(Integer id) {
        adminsMapper.delAdm(id);
    }

}
